﻿@model SchoolCommunicationSystem.Models.TeacherAddViewModel
@{
    ViewBag.Title = "Tạo tài khoản giáo viên";
}

<script>
    $(document).ready(function () {
        document.getElementById('subjectGenerated').style.display = 'none';
        $("input[type=radio]").change(function () {
            if (document.getElementById('isLeaderTeacher') != null) {
                if (document.getElementById('isLeaderTeacher').checked) {
                    document.getElementById('subjectGenerated').style.display = 'block';
                }
                else {
                    document.getElementById('subjectGenerated').style.display = 'none';
                }
            }
        });
    });
</script>
<div id="page-heading">
    <h1>Quản lý tài khoản</h1>
</div>
<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4>Tạo tài khoản giáo viên</h4>
                </div>
                <div class="panel-body">
                    <h3>Tài khoản giáo viên</h3>
                    <br>
                    @using (Html.BeginForm("CreateAccountTeacher", "AccountManagement", FormMethod.Post, new { @class = "form-horizontal" }))
                    {
                        @Html.ValidationSummary(true)
                        <div class="form-group">
                            @Html.Label("Tên giáo viên", new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.DropDownListFor(model => model._teacherID, Model.TeacherSelectList, "[Hãy chọn giáo viên]", new { @class = "form-control" })
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(model => model._teacherID)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.Label("Là trưởng bộ môn?", new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-2">
                                <div class="checkbox block">
                                @Html.RadioButtonFor(model => model.isLeaderTeacher, true) Có
                                @Html.RadioButtonFor(model => model.isLeaderTeacher, false, true) Không
                                    </div>
                            </div>
                            <div class="col-sm-3" id="subjectGenerated">
                                @Html.DropDownListFor(model => model._subjectID, Model.SubjectSelectList, new { @class = "form-control", @style="height:30px;padding:4px 5px 4px 4px;" })
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(model => model.isLeaderTeacher)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.UserName, new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.EditorFor(m => m.UserName, new { @maxlength = 25 })
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(m => m.UserName)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.Password, new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.PasswordFor(m => m.Password)
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(m => m.Password)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.PasswordFor(m => m.ConfirmPassword)
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(m => m.ConfirmPassword)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.Email, new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.EditorFor(m => m.Email)
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(m => m.Email)
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-sm-offset-3">
                                <div class="btn-toolbar">
                                    <button class="btn-primary btn" type="submit">Tạo Tài Khoản</button>
                                </div>
                            </div>
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>
</div>
